package com.garvin.spring.service;

import com.garvin.spring.mapper.UserMapper;
import com.garvin.spring.model.User;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.NativeWebRequest;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import javax.jws.soap.SOAPBinding;
import java.util.List;

@Service
public class LoginService {

    @Resource
    private UserMapper userMapper;

    public String login(String name, String password) {
        User user1 = new User();
        user1.setUsername(name);

        Example example = new Example(User.class);
        example.createCriteria()
                .andEqualTo("username", name);
        User byExample = userMapper.selectOneByExample(example);
        User user = userMapper.selectOne(null);
        if (user.getPassword().equals(password)) {

        }
        return null;
    }
}
